/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.arecieve.entity;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.modules.base.entity.cars.Tcar;
import com.jeesite.modules.base.entity.customer.Customer;
import com.jeesite.modules.base.entity.fixedexpense.FixedExpense;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 收款单Entity
 * @author wsm
 * @version 2021-03-22
 */
@Table(name="t_receivable_detail", alias="a", columns={
		@Column(name="receivable_detail_id", attrName="receivableDetailId", label="收款单明细ID", isPK=true),
		@Column(name="brand", attrName="brand", label="品牌"),
		@Column(name="area", attrName="area", label="版型"),
		@Column(name="row_number", attrName="rowNumber", label="行号"),
		@Column(name="model", attrName="model", label="车型"),
		@Column(name="car_id", attrName="carId", label="车辆"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="expense_item", attrName="expenseItem", label="费用项目"),
		@Column(name="ar_amount", attrName="arAmount", label="应收金额"),
		@Column(name="actual_ar_amount", attrName="actualArAmount", label="实收金额"),
		@Column(name="invoice_amount", attrName="invoiceAmount", label="开票金额"),
		@Column(name="remarik", attrName="remarik", label="备注"),
		@Column(name="ar_code", attrName="arCode", label="应收单", isQuery=false),
		@Column(name="advances_received_code", attrName="advancesReceivedCode", label="预收款编号"),
		@Column(name="received_left", attrName="receivedLeft", label="剩余应付金额"),
		@Column(name="received_balance", attrName="receivedBalance", label="预收款余额"),
		@Column(name="receivable_id", attrName="receivableId.receivableId", label="收款单ID"),
	},joinTable= {
		@JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = Tcar.class, attrName = "tcar", alias = "b",
				on = "b.car_id = a.car_id", columns = {
				@Column(name = "car_id", label = "车辆id", isPK = true),
				@Column(name = "car_name", label = "车辆名称"),
		}),
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= FixedExpense.class, attrName="fixedExpense", alias="c",
				on="c.fixed_expense_id = a.expense_item", columns={
				@Column(name="fixed_expense_id", label="类型id", isPK=true),
				@Column(name="fixed_expense_name", label="类型名称"),
		}),
} , orderBy="a.receivable_detail_id ASC"
)
public class TreceivableDetail extends DataEntity<TreceivableDetail> {

	private static final long serialVersionUID = 1L;
	private String receivableDetailId;		// 收款单明细ID
	private String brand;		// 品牌
	private String area;		// 版型
	private String model;		// 车型
	private String carId;		// 车辆
	private String frameNumber;		// 车架号
	private String expenseItem;		// 费用项目
	private Double arAmount;		// 应收金额
	private Double actualArAmount;		// 实收金额
	private Double invoiceAmount;		// 开票金额
	private String remarik;		// 备注
	private Treceivable receivableId;		// 收款单ID 父类
	private String arCode;//应收单
	private String advancesReceivedCode;		// 预收款编号
	private String advancesReceivedCode1;		// 预收款编号
	private Double receivedBalance;		// 预收款余额
	private Double receivedLeft;
	private String expenseItemName;
	private Long rowNumber;
	private Tcar tcar;
	private FixedExpense fixedExpense;
	private String advancesReceivedStatus;

	public String getAdvancesReceivedCode1() {
		return advancesReceivedCode1;
	}

	public void setAdvancesReceivedCode1(String advancesReceivedCode1) {
		this.advancesReceivedCode1 = advancesReceivedCode1;
	}

	public FixedExpense getFixedExpense() {
		return fixedExpense;
	}

	public void setFixedExpense(FixedExpense fixedExpense) {
		this.fixedExpense = fixedExpense;
	}

	public Long getRowNumber() {
		return rowNumber;
	}

	public void setRowNumber(Long rowNumber) {
		this.rowNumber = rowNumber;
	}

	public Tcar getTcar() {
		return tcar;
	}

	public void setTcar(Tcar tcar) {
		this.tcar = tcar;
	}

	public String getExpenseItemName() {
		return expenseItemName;
	}

	public void setExpenseItemName(String expenseItemName) {
		this.expenseItemName = expenseItemName;
	}

	public String getArCode() {
		return arCode;
	}

	public void setArCode(String arCode) {
		this.arCode = arCode;
	}

	public String getAdvancesReceivedCode() {
		return advancesReceivedCode;
	}

	public void setAdvancesReceivedCode(String advancesReceivedCode) {
		this.advancesReceivedCode = advancesReceivedCode;
	}

	public Double getReceivedBalance() {
		return receivedBalance;
	}

	public void setReceivedBalance(Double receivedBalance) {
		this.receivedBalance = receivedBalance;
	}

	public Double getReceivedLeft() {
		return receivedLeft;
	}

	public void setReceivedLeft(Double receivedLeft) {
		this.receivedLeft = receivedLeft;
	}

	public TreceivableDetail() {
		this(null);
	}


	public TreceivableDetail(Treceivable receivableId){
		this.receivableId = receivableId;
	}

	public String getReceivableDetailId() {
		return receivableDetailId;
	}

	public void setReceivableDetailId(String receivableDetailId) {
		this.receivableDetailId = receivableDetailId;
	}

	@Length(min=0, max=2, message="品牌长度不能超过 2 个字符")
	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	@Length(min=0, max=64, message="版型长度不能超过 64 个字符")
	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	@Length(min=0, max=100, message="车型长度不能超过 100 个字符")
	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	@Length(min=0, max=64, message="车辆长度不能超过 64 个字符")
	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}

	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}

	@Length(min=0, max=100, message="费用项目长度不能超过 100 个字符")
	public String getExpenseItem() {
		return expenseItem;
	}

	public void setExpenseItem(String expenseItem) {
		this.expenseItem = expenseItem;
	}

	public Double getArAmount() {
		return arAmount;
	}

	public void setArAmount(Double arAmount) {
		this.arAmount = arAmount;
	}

	public Double getActualArAmount() {
		return actualArAmount;
	}

	public void setActualArAmount(Double actualArAmount) {
		this.actualArAmount = actualArAmount;
	}

	public Double getInvoiceAmount() {
		return invoiceAmount;
	}

	public void setInvoiceAmount(Double invoiceAmount) {
		this.invoiceAmount = invoiceAmount;
	}

	@Length(min=0, max=255, message="备注长度不能超过 255 个字符")
	public String getRemarik() {
		return remarik;
	}

	public void setRemarik(String remarik) {
		this.remarik = remarik;
	}

	@Length(min=0, max=64, message="收款单ID长度不能超过 64 个字符")
	public Treceivable getReceivableId() {
		return receivableId;
	}

	public void setReceivableId(Treceivable receivableId) {
		this.receivableId = receivableId;
	}

	public String getAdvancesReceivedStatus() {
		return advancesReceivedStatus;
	}

	public void setAdvancesReceivedStatus(String advancesReceivedStatus) {
		this.advancesReceivedStatus = advancesReceivedStatus;
	}
}
